<?php 
require $this->website['path']['action'].'/admin/islogin.php';

// 返回用户分页列表
// 

$p = fn_post('p',1);
$field = fn_post('field');
$value = fn_post('value');
$condition = fn_post('condition');
$sys = $this->website['class']['unity']->configura('sys');
$json = array('status'=>'ok','msg'=>'paging','data'=>'');



$this->website['class']['db']
     ->table('user_admin')
     ->page($p)
     ->order('id desc')
       ->num($sys['pagingnum']);

if($field && $value && $condition){
  switch($condition){
    case 'like':
      $this->website['class']['db']
           ->where($field.' like ?','%'.$value.'%');
      break;
    default:
      $this->website['class']['db']
           ->where($field.'=?',$value);
  }
}

$json['data'] = $this->website['class']['db']->paging();
// $json['sql'] = $this->website['class']['db']->sql;


echo json_encode($json);